
clear all
set mem 5000m
set more off

global path = "C:\Users\creto\Desktop\chinese_students_2017"

local date "$S_DATE"
local date =subinstr("`date'"," ", "",.)
di "`date'"

cap log close
*log using "$path/Logfiles/bhj_shiftshare_analysis_`date'.log", replace


** Table 1a
	
	
*********************************************************
**STEP 3: SSAGGREGATE AND REPLICATE***
**MAIN RESULTS AS CHECK
*********************************************************
	
	
	cd "$path/Data/6.AnalysisData/bhj_ss_analysis_July2021"
	
		**load data and create 0213 changes in students
		use "$path/Submissions/ReStat/Replication Files 2022/kswxy_data", clear
		
		drop if citycode==.
		sort citycode year
		
		keep if year==2013
		keep citycode shc_stud_tot_0213 shc_stud_tot_0413 iv_ntr contract_cons_exw97 chinatariff00_expw97 inputtariff02_expw97 share_revenue_exw97
		

		

		**SSAGGREGATE TO SHOCK LEVEL
		gen constant =1
		local controls1 "constant"
		local controls2 "chinatariff00_expw97"
		local controls3 "chinatariff00_expw97 share_revenue_exw97"
		local controls4 "chinatariff00_expw97 share_revenue_exw97 inputtariff02_expw97"
		local controls5 "chinatariff00_expw97 share_revenue_exw97 inputtariff02_expw97 contract_cons_exw97"
		
		ssaggregate shc_stud_tot_0213 iv_ntr, n(isic) s(beta_pi_hasshock) l(citycode) controls("`controls1'" "`controls2'" "`controls3'" "`controls4'" "`controls5'") sfilename(exp97shares_long) addmissing 
		
		
		//merge ntrgaps
		*merge in NTR gaps
		gen isic_str=string(isic)
		merge m:1 isic_str using "$path/Data/PSdata/isic_gap_manuf.dta"
		keep if _merge==3
		drop _merge
		rename s1999 ntrgap

		
		unique isic // should be 119
		
		
		
		
		**MAIN REGRESSIONS, REPLICATE USING SSAGGREGATED DATA
		eststo A: ivreg shc_stud_tot_02131 (iv_ntr1=ntrgap) [aw=s_n], rob

		eststo B:  ivreg shc_stud_tot_02132 (iv_ntr2=ntrgap) [aw=s_n], rob

		eststo C:  ivreg shc_stud_tot_02133 (iv_ntr3=ntrgap) [aw=s_n], rob

		eststo D:  ivreg shc_stud_tot_02134 (iv_ntr4=ntrgap) [aw=s_n], rob

		eststo E:  ivreg shc_stud_tot_02135 (iv_ntr5=ntrgap) [aw=s_n], rob

		esttab A B C D E, b(3) se(3) keep(iv_ntr*) star(* 0.10 ** 0.05 *** 0.01) coeflabels(iv_ntr1 "No Controls" iv_ntr2 "+Control for Import Tariffs" ///
			iv_ntr3 "+Control for Export Licenses" iv_ntr4 "+Control for Input Tariffs" iv_ntr5 "+Control for Contract Intensity") nomtitles ///
			stats(N r2, labels("Obs." "R2") fmt(%12.0fc %12.2fc))  

			










		**BHJ TABLE 1: SUMMARY STATS OF SHOCKS

		gsort -isic
		gen table1_var="."
		replace table1_var="mean" in 1
		replace table1_var="s.d." in 2
		replace table1_var="IQR"  in 3
		replace table1_var="1/HHI"  in 4
		replace table1_var="Largest_emp_share"  in 5
		replace table1_var="# shocks" in 6
		replace table1_var="# industries" in 7


		gen Col1=.
		
		*** Col. 1, all shocks including services ***

		* create relevant employment shares, across all observations by periods
		egen share_col1=pc(s_n), prop


		sum ntrgap [aw=share_col1], d
			replace Col1 = r(mean) in 1
			replace Col1 = r(sd) in 2
			replace Col1 = r(p75)-r(p25) in 3
			
			
		egen hhi1 = sum(share_col1^2)
		replace Col1 = 1/hhi1 in 4
		gen one_over_hhi1 = 1/hhi1


		sum share_col1
		replace Col1 = r(max) in 5


		* Statistics on sample:
		* all
		distinct ntrgap
		replace Col1 = r(ndistinct) in 6



		distinct isic
		replace Col1 = r(ndistinct) in 7 
	

		*Mean, SD, IQR
		eststo A1: estpost tabstat ntrgap [aw=share_col1], listwise stats(mean sd iqr) columns(v)
		esttab A1 using "$path/Submissions/ReStat/Replication Files 2022/bhj_table1.tex", replace cells(ntrgap(fmt(3)))  mtitles("") coeflabels(mean "Mean" sd "Std. Dev." iqr "IQR (p75-p25)") collabels(none) noobs booktabs postfoot("") 
		*Max importance weight
		preserve
		replace ntrgap = share_col1
		eststo A2: estpost tabstat ntrgap, listwise stats(max) columns(v)
		esttab A2 using "$path/Submissions/ReStat/Replication Files 2022/bhj_table1.tex", append cells(ntrgap(fmt(3))) coeflabels(max "Largest importance weight") collabels(none) noobs nomtitles nonumbers nogaps nolines prehead("") posthead("") postfoot("") prefoot("") booktabs 
		
		restore
		
		
		*1/HHI
		preserve

		replace ntrgap = one_over_hhi1
		eststo B1: estpost tabstat ntrgap, listwise stats(mean) columns(v) 
				
		esttab B1 using "$path/Submissions/ReStat/Replication Files 2022/bhj_table1.tex", append cells(ntrgap(fmt(3))) coeflabels(mean "1/HHI") collabels(none) noobs nomtitles nonumbers nogaps nolines prehead("") posthead("") postfoot("") prefoot("") booktabs 
		restore

		*Number of Shocks
		eststo C1: estpost tabstat ntrgap, listwise stats(N) columns(v) 
		
		esttab C1 using "$path/Submissions/ReStat/Replication Files 2022/bhj_table1.tex", append cells("ntrgap") coeflabels(count "\# Shocks") collabels(none) noobs nomtitles nonumbers nogaps nolines prehead("") posthead("") postfoot("") prefoot("") booktabs 

		*Number of Industries
		preserve
		replace ntrgap = isic
		eststo D1: estpost tabstat ntrgap if s_n!=. , listwise stats(N) columns(v) 	
		esttab D1 using "$path/Submissions/ReStat/Replication Files 2022/bhj_table1.tex", append cells("ntrgap") coeflabels(count "\# Industries") collabels(none) noobs nomtitles nonumbers nogaps nolines prehead("") posthead("") prefoot("\bottomrule") booktabs 
		restore


		
			
			
	
** Table 1b

	
	
	
	
	
	//INDUSTRY BALANCE
preserve	
	//Contract intensity, 1997
	use "$path/Data/Nunn/contract_intensity.dta", clear
	tostring isic, gen(isic_str)
	keep isic_str contract_cons contract_liberal
	rename contract_cons contract_cons1997 
	rename contract_liberal contract_liberal1997
	tempfile contract_intensity
	save "`contract_intensity'"
	
	//Export Requirements, 2000
	use "$path/Data/Export Licenses/export_req.dta", clear
	keep if year==2000
	tostring isic, gen(isic_str)
	keep isic_str share_revenue fraction_nfirm
	rename share_revenue share_revenue2000
	rename fraction_nfirm fraction_nfirm2000
	tempfile export_req
	save "`export_req'"
	
	//Import tariffs, 2000
	use "$path/Data/Tariffs/chinatariffs.dta", clear
	keep if year==2000
	tostring isic, gen(isic_str)
	keep isic_str chinatariff_isic
	rename chinatariff_isic importtariff2000
	replace importtariff2000 = log(1+importtariff2000/100)
	tempfile import_tariff
	save "`import_tariff'"
	
	//Input tariffs, 2002
	use "$path/Data/Tariffs/inputtariffs.dta", clear
	keep isic_str inputtariff_isic
	rename inputtariff_isic inputtariff2002
	compress
	tempfile input_tariff
	save "`input_tariff'"
	
	//Other firm vars from ASIP, 2000
	use ASIP2000, clear
	
	gen labor_va_2000 = laborpayment / va
	gen cap_va_2000 = fixedasset/va 
	gen roa_2000 = profit/asset
	gen roe_2000 = profit/equity_tot
		
	collapse (mean) labor_va cap_va roa roe, by(isic)
	
	rename isic isic_str
	
	tempfile indvars00
	save "`indvars00'"
restore	
	
	
		
		merge m:1 isic_str using "`contract_intensity'"
				**impute missing export_req with isic3 or isic2 medians
					gen isic3 = substr(isic_str,1,3)
					gen isic2 = substr(isic_str,1,2)
					foreach var in contract_liberal1997 contract_cons1997 {
					egen misic3_`var' = median(`var'), by(isic3)
					egen misic2_`var' = median(`var'), by(isic2)
					replace `var' = misic3_`var' if `var'==.
					replace `var' = misic2_`var' if `var'==.
					}
					drop isic3 isic2 misic*
		drop if _merge==2
		drop _merge
		
		merge m:1 isic_str using "`export_req'"
				**impute missing export_req with isic3 or isic2 medians
					gen isic3 = substr(isic_str,1,3)
					gen isic2 = substr(isic_str,1,2)
					foreach var in share_revenue2000 fraction_nfirm2000 {
					egen misic3_`var' = median(`var'), by(isic3)
					egen misic2_`var' = median(`var'), by(isic2)
					replace `var' = misic3_`var' if `var'==.
					replace `var' = misic2_`var' if `var'==.
					}
					drop isic3 isic2 misic*
		drop if _merge==2
		drop _merge
		
		merge m:1 isic_str using "`import_tariff'"
		replace importtariff2000 = ln(1+(importtariff2000))
		drop if _merge==2
		drop _merge
		
		merge m:1 isic_str using "`input_tariff'"
			**impute missing input_tariff with isic3 or isic2 medians
					gen isic3 = substr(isic_str,1,3)
					gen isic2 = substr(isic_str,1,2)
					gen isic1 = substr(isic_str,1,1)
					foreach var in inputtariff2002 {
					egen misic3_`var' = median(`var'), by(isic3)
					egen misic2_`var' = median(`var'), by(isic2)
					egen misic1_`var' = median(`var'), by(isic1)
					replace `var' = misic3_`var' if `var'==.
					replace `var' = misic2_`var' if `var'==.
					replace `var' = misic1_`var' if `var'==.
					}
		drop isic3 isic2 isic1 misic*
		drop if _merge==2
		drop _merge
		
		
		merge m:1 isic_str using "`indvars00'"
			**impute missing input_tariff with isic3 or isic2 medians
					gen isic3 = substr(isic_str,1,3)
					gen isic2 = substr(isic_str,1,2)
					gen isic1 = substr(isic_str,1,1)
					foreach var in labor_va cap_va roa roe {
					egen misic3_`var' = median(`var'), by(isic3)
					egen misic2_`var' = median(`var'), by(isic2)
					egen misic1_`var' = median(`var'), by(isic1)
					replace `var' = misic3_`var' if `var'==.
					replace `var' = misic2_`var' if `var'==.
					replace `var' = misic1_`var' if `var'==.
					}
		drop isic3 isic2 isic1 misic*
		drop if _merge==2
		drop _merge
		
		drop if isic==.
		
		estimates clear
		
		foreach v in contract_liberal1997 contract_cons1997 share_revenue2000 fraction_nfirm2000 importtariff2000 inputtariff2002 {
							
		eststo : reg `v' ntrgap [aw=s_n], cluster(isic)
		
		}
		
		*merge in Chinese skill shares 2004
		tostring isic, replace
		merge m:1 isic using "$path/Data/6.AnalysisData/Robust-skill_content/Sk_ISIC_CHN04"
		drop if _merge==2
		destring isic, replace
		drop if isic==.
		sum skillsh
		*replace skillsh = r(mean) if skillsh==.
		drop _merge
		rename skillsh skillsh_cn
		

		*merge in Indonesian skill shares 1992
		tostring isic, replace
		merge m:1 isic using "$path/Data/6.AnalysisData/Robust-skill_content/Sk_ISIC_IND96"
		drop if _merge==2
		destring isic, replace
		drop if isic==.
		sum skillsh
		replace skillsh = r(mean) if skillsh==.
		drop _merge
		rename skillsh skillsh_in
		
		*merge skill shares
		rename isic_str isic4
		merge m:1 isic4 using "$path/Data/6.AnalysisData/Robust-skill_content/Sksh_Census19902000"		
		drop if _merge==2
		foreach var of varlist sksh1_1990 sksh2_1990 sksh1_2000 sksh2_2000 {
		sum `var'
		replace `var' = r(mean) if `var'==.
		}
	
	estimates clear
	
	
	eststo contract: reg contract_cons1997 ntrgap [aw=s_n], cluster(isic)
	eststo import: reg importtariff2000 ntrgap [aw=s_n], cluster(isic)
	eststo input: reg inputtariff2002 ntrgap [aw=s_n], cluster(isic)
	eststo license: reg share_revenue2000 ntrgap [aw=s_n], cluster(isic)
	
	eststo labor_va: reg labor_va ntrgap [aw=s_n], cluster(isic)
	eststo cap_va: reg cap_va ntrgap [aw=s_n], cluster(isic)
	eststo roa: reg roa ntrgap [aw=s_n], cluster(isic)
	eststo roe: reg roe ntrgap [aw=s_n], cluster(isic)
	
	eststo skill1: reg skillsh_cn ntrgap [aw=s_n] if skillsh_cn<0.35 , cluster(isic)
	eststo skill2: reg skillsh_in ntrgap [aw=s_n], cluster(isic)

	esttab skill1 skill2, b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) mtitles("China" "Indonesia") nocons
	
	eststo skill901: reg sksh1_1990 ntrgap [aw=s_n], cluster(isic)
	eststo skill902: reg sksh1_1990 ntrgap [aw=s_n], cluster(isic)
	eststo skill001: reg sksh1_2000 ntrgap [aw=s_n], cluster(isic)
	eststo skill002: reg sksh1_2000 ntrgap [aw=s_n], cluster(isic)
	esttab contract import input license labor_va cap_va roa roe, star(* 0.10 ** 0.05 *** 0.01) 
	
	
	esttab contract using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", replace booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Contract intensity, 1997") nonotes postfoot("") 
	esttab import using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Import tariffs, 2000") nonotes nonumbers prehead("") posthead("") prefoot("") postfoot("") nolines		
	esttab input using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Input tariffs, 2002") nonotes	nonumbers prehead("") posthead("") prefoot("") postfoot("") nolines			
	esttab license using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Export licenses, 2000") nonotes	nonumbers prehead("") posthead("") prefoot("") postfoot("")  nolines			
	esttab labor_va using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Ratio of labor to value-added, 2000") nonotes	nonumbers prehead("") posthead("") prefoot("") postfoot("")  nolines			
	esttab cap_va using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles	varlabels(ntrgap "Ratio of capital to value-added, 2000") nonotes	nonumbers prehead("") posthead("") prefoot("") postfoot("")  nolines			
	esttab roa using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles varlabels(ntrgap "Return on assets, 2000") nonotes	nonumbers prehead("") posthead("") prefoot("") postfoot("")  nolines			
	esttab roe using "$path/Submissions/ReStat/Replication Files 2022/bhj_table2.tex", append booktabs b(%9.3f) se(%9.3f) nocon star(* 0.10 ** 0.05 *** 0.01) noobs nogaps nomtitles varlabels(ntrgap "Return on equity, 2000") nonotes	nonumbers prehead("") posthead("") prefoot("\bottomrule") stats(N, label("Industries") fmt(%12.0fc))					

	
	
	
	
	
	
	
	** Table 2

	
	
	

	
			
	***REGIONAL CORRELATIONS
	
	estimates clear
	estimates drop _all

	**NEW BHJ INDICATORS
	cd "$path/Data/6.AnalysisData/bhj_ss_analysis_July2021"
	
	use Data_infor1, clear
	rename chinacity citycode
	
	keep if year<=2000
	duplicates drop citycode year, force
	reshape wide capital emp_manu sh_emp_manu sh_capital, i(citycode) j(year)
	
	
	
	gen pct_capital_9700 = (capital2000-capital1997)/capital1997
	gen pct_emp_manu_9700 = (emp_manu2000-emp_manu1997)/emp_manu1997
	gen pct_capital_9400 = (capital2000-capital1994)/capital1994
	gen pct_emp_manu_9400 = (emp_manu2000-emp_manu1994)/emp_manu1994
	
	
	foreach x in sh_emp_manu sh_capital {
	gen ch_`x'_9700 = `x'2000-`x'1997
	gen ch_`x'_9400 = `x'2000-`x'1994
	}
	
	keep citycode sh_emp_manu1994 sh_emp_manu1995 sh_emp_manu1996 sh_emp_manu1997 ///
			                sh_capital1994 sh_capital1995 sh_capital1996 sh_capital1997 ///
							pct_capital* pct_emp* ch_*
							
	tempfile data1
	save "`data1'"
	
	
	
	use Data_infor2, clear
	
	*backout numerators of shares
	gen  pop18 = popsh_18 * totpop 
	gen  pop18plus= popsh_18plus * totpop
	gen  emp_sk = empsh_sk * totemp
	
	keep year citycode popsh_18plus popsh_18 empsh_sk pop18 pop18plus emp_sk
	keep if year==2000| year==1990
	duplicates drop citycode year, force
	
	reshape wide popsh_18plus popsh_18 empsh_sk pop18 pop18plus emp_sk , i(citycode) j(year)
	
	foreach var in pop18 pop18plus emp_sk {
	
		gen pct_`var'_9000 = (`var'2000 - `var'1990)/`var'1990
		
		}
	
	foreach x in popsh_18plus popsh_18 empsh_sk {
	gen ch_`x'_9000 = `x'2000-`x'1990
	}
	
	tempfile data2
	save "`data2'"
	
	merge 1:1 citycode using "`data1'"
	drop _merge
	
	tempfile bhj_lags
	save "`bhj_lags'"
	

	
	
**ECONOMIC INDICATORS, REPLICATING USING SS AGGREGATE
	cd "$path/Data/6.AnalysisData/bhj_ss_analysis_July2021"
	
	use "$path/Submissions/ReStat/Replication Files 2022/kswxy_data", clear
	
	keep if year==2013
	drop if citycode==.
	
	
	*merge in new bhj variables to check
	merge 1:1 citycode using "`bhj_lags'",
	drop if _merge==2
	drop _merge
	
	
	
	gen constant =1
	local controls1 "constant"
	local controls2_emp "chinatariff_empwtd90_isic share_revenue_empwtd90_isic inputtariff_empwtd90_isic contract_cons_empwtd90_isic"
	local controls2_exp "chinatariff00_expw97 share_revenue_exw97 inputtariff02_expw97 contract_cons_exw97"

	rename ntrgap_empwtd90_isic ntrgap_emp
	rename ntrgap_exw97 ntrgap_exp

	
	gen sample_exp = ntrgap_exp!=. & shc_stud_tot_0213!=.
	gen sample_emp = ntrgap_emp!=. & shc_stud_tot_0213!=.
	
	

	
	foreach v in exp /*emp*/ {
	
	local l = 1 //counter for eststo
	
	if "`v'"=="exp" {
		local controls2 "chinatariff00_expw97 share_revenue_exw97 inputtariff02_expw97 contract_cons_exw97"
		local beta "beta_pi_hasshock"
		local file "exp97shares_long"
	}
	
	if "`v'"=="emp" {
		local controls2 "chinatariff_empwtd90_isic share_revenue_empwtd90_isic inputtariff_empwtd90_isic contract_cons_empwtd90_isic"
		local beta "beta_pi"
		local file "emp90isicshares_long"
	}
	
	
	
		foreach x in 		popsh_181990 empsh_sk1990 /// 1 2 
						    sh_emp_manu1994 sh_capital1994 /// 3 4
						   	ch_popsh_18_9000 ch_empsh_sk_9000 /// 5 6
							ch_sh_emp_manu_9400 ch_sh_capital_9400 /// 7 8 
							lnc_gdp_9700  lnc_emp_9700 lnc_inv_fdi_9700 lnc_inv_realest_9700 lnc_dvalue_9700 /// 9 10 11 12 13 
							shc_stud_tot_0001_pop04  lnc_numstd_college_9700 lnc_num_college_9700 /// 14 15 16
							lnc_numstd_midschool_9700 lnc_num_midschool_9700 { // 17 18
					 	 	
			
			preserve
			
			keep if sample_`v'==1 //retain only sample cities in emp or exp shares sample
				
				
				
	
				*calculate # cities
				qui tab citycode if `x'!=. & sample_exp==1 
				di r(r)
				gen sample_`x'=r(r)
				
				*store # cities as 3rd column for tables
				drop iv_ntr
				gen iv_ntr=1
				eststo C`l'_`v': reg sample_`x' iv_ntr, nocons
				drop iv_ntr sample_`x'
				
				
				
				
			**BHJ aggregation to industry	
			ssaggregate `x'  ntrgap_`v', n(isic) s(`beta') l(citycode) controls("`controls1'" "`controls2'") sfilename(`file')  addmissing
			
			
				
			*merge in NTR gaps
			gen isic_str=string(isic)
			merge m:1 isic_str using "$path/Data/PSdata/isic_gap_manuf.dta"
			keep if _merge==3
			drop _merge
			rename s1999 ntrgap
			
			
			*regressions
			rename ntrgap_`v'1 iv_ntr
			qui eststo A`l'_`v': ivreg2 `x'1 (iv_ntr=ntrgap) [aw=s_n], rob //no controls
			rename iv_ntr ntrgap_`v'1
			
			rename ntrgap_`v'2 iv_ntr //simple renaming so can stack results in a column using esttab
			qui eststo B`l'_`v': ivreg2 `x'2 (iv_ntr=ntrgap) [aw=s_n], rob //all controls
			rename iv_ntr ntrgap_`v'2 
		
		restore
		
	local l = `l'+1	
	}
	
	}
		
		
		tab sample_exp
		*tab sample_emp
		
		estadd local cities "268": A18_exp B18_exp A8_exp B8_exp
		*estadd local cities "258": A18_emp B18_emp

		esttab A14_exp B14_exp C14_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", replace booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) mtitles("\shortstack{Export Share\\No Controls}" "\shortstack{Export Share\\All Controls}" "\shortstack{Number of Cities\\(Obs.)}") varlabels(iv_ntr "Change in Chinese Students/City Pop 2000, 2000-2001", ///
		blist(iv_ntr "\midrule \it{\underline{A: Education Indicators}} \\")) posthead("") prefoot("") postfoot("") nogaps noobs 
		esttab A15_exp B15_exp C15_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Chinese College Students, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A16_exp B16_exp C16_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Chinese Colleges, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A17_exp B17_exp C17_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Chinese Middle School Students, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A18_exp B18_exp C18_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Chinese Middle Schools, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
	
		
		esttab A9_exp B9_exp C9_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in GDP, 1997-2000", ///
		blist(iv_ntr "\midrule \it{\underline{B: Economic Indicators}} \\")) prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A10_exp B10_exp C10_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Employment, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A11_exp B11_exp C11_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in FDI, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A12_exp B12_exp C12_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Real Estate Inv., 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A13_exp B13_exp C13_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Log Change in Exports, 1997-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
	
		esttab A1_exp B1_exp C1_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Share of 18 y.o. in Population, 1990", ///
		blist(iv_ntr "\midrule \it{\underline{C: Demographics \& Skill/Capital Intensity}} \\")) prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A2_exp B2_exp C2_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Share of College Educated Workers, 1990") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A3_exp B3_exp C3_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Manufacturing Employment Share, 1994") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A4_exp B4_exp C4_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Capital Share in Output, 1994") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A5_exp B5_exp C5_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Change in Share of 18 y.o. in Population, 1990-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A6_exp B6_exp C6_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Change in Share of College Educated Workers, 1990-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A7_exp B7_exp C7_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Change in Manufacturing Employment Share, 1994-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
		esttab A8_exp B8_exp C8_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(iv_ntr) varlabels(iv_ntr "Change Capital Share in Output, 1994-2000") prehead("") posthead("") prefoot("") postfoot("") nogaps noobs nomtitles nolines nonumbers
	
		esttab A8_exp B8_exp C8_exp using "$path/Submissions/ReStat/Replication Files 2022/bhj_table3.tex", append booktabs type star(* 0.10 ** 0.05 *** 0.01) drop(*) nomtitles substitute(\_ _) nonotes noobs nonumbers posthead("")  prehead("") 

	
		***WARNING. MANUAL REPLACEMENTS NEEDED FOR FORMATTING
		** OPEN THE TEX FILE FOR TABLE3
		** FIND (.) AND REPLACE WITH BLANK
		** FIND .000 AND REPLACE WITH BLANK
		** SAVE FILE
		
	
	